// 缓存本地
const save=(key:string,value:any):void=>{
    if(typeof value ==="object"){
        value=JSON.stringify(value)
    }
    localStorage.setItem(key,value)
}

// 读取缓存
const read=(key:string):string|null=>{
    let value=localStorage.getItem(key)
    return value
}

// 删除缓存
const remove=(key:string):void=>{
    localStorage.removeItem(key)
}

// 清空缓存
const clear=():void=>{
    localStorage.clear()
}